﻿<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>菜单管理</title>
	<meta name="decorator" content="default"/>
	<tags:import includes="treetable,treetableCss"></tags:import>
	<script src="${ctxStatic}/modules/sys/menu.js"></script>
	<script type="text/javascript">		
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#frmSearch").submit();
			return false;
		}
	</script>
</head>
<body>
	<br>
	<form id="frmSearch" modelAttribute="menu" action="${ctx}/sys/menu/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>		
		<!--添加查询条件-->
		&nbsp;
		<input id="btnQuery" class="btn btn-success"" type="submit" value="查询"/>
		&nbsp;<button type="button" class="btn"  id="btnNew">新增</button>
		&nbsp;<button type="button" class="btn"  id="btnDelete">删除</button>
		
	</form>
	<br><br>
	<table id="contentTable" class="table table-striped table-bordered  table-hover"">		
		<thead>
		<tr>
			<th class="center" style="width: 50px;">
				<label> 
					<input type="checkbox" class="ace" /> <span class="lbl"></span>
				</label>
			</th>
			<th>名称</th>
	        <th>操作</th>
		<tbody> 	
		<c:forEach items="${pages.list}" var="menu">		
		<tr id="${menu.id}"  pId="${menu.parentId}">			
			<td class="center">
				<label>
					<input value="${dict.id}" type="checkbox" class="ace" /> 
					<span class="lbl"></span></label>
			</td>
			<td><span controller="true">${menu.label}</span></td>			
			<td>
				 <a href="javascript:onUpdate('${menu.id}')">修改</a> 
				 <a href="javascript:onDelete('${menu.id}')">删除</a>
			</td>
		</tr>
		</c:forEach>
		</tbody>
	</table> 
	${pages}
	<!-- 模态窗体 -->
	<div id="modalTable" action="new" class="modal fade"  style="display:none;width:462px;" tabindex="-1">
		<div class="modal-dialog">
			<div class="modal-content" style="width: 460px; height: 423px;">
				<div class="modal-header no-padding">
					<div class="table-header">
						<button type="button" class="close" data-dismiss="modal"
							aria-hidden="true">
							<span class="white">&times;</span>
						</button>
						<span id='modalTitle'>新增窗体</span>
					</div>
				</div>
				<br>
				<!-- 新增窗体内部 -->
				<form id="frmSubmit" class="form-horizontal" role="form"  method="post">
					<input type="hidden" name="id"  uname="update"/>
					<input type="hidden"  id="callbackPID" name="parentId"  uname="update"/>
					<input type="hidden"  id='callbackPIDS' name="parentIds"  uname="update"/>									
					<input type="hidden" name="userId" value="${userId}" uname="update"/>		
				    <div class="form-group">
							<label class="col-sm-3 control-label no-padding-right">父级节点</label>
							<div class="col-sm-9">
								<div class="input-group" style="width: 281px;height: 10px;">
								<input class="form-control" 
									id="callbackName" 
									type="text"
									name="parentName"  
									uname="update"
									value="父级节点"
									style="height: 29px;">									
									<span id="btnSelectTree"  class="input-group-addon" style="cursor: hand;">
										<i class="icon-search bigger-110"></i>
									</span>
								</div>									
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label no-padding-right">菜单名称</label>
							<div class="col-sm-9">
								<input type="text" class="col-xs-10"
									name="label" uname="update"/>
							</div>
						</div>					        					
				        <div class="form-group">
							<label class="col-sm-3 control-label no-padding-right">图标字符</label>
							<div class="col-sm-9">
								<input type="text" class="col-xs-10"
									name="icon" uname="update"/>
							</div>
						</div>						
				        <div class="form-group">
							<label class="col-sm-3 control-label no-padding-right">路径</label>
							<div class="col-sm-9">
								<input type="text" class="col-xs-10"
									name="url" uname="update"/>
							</div>
						</div>						
				        <div class="control-group">
							<label class="col-sm-3 control-label no-padding-right">权限</label>
							<div class="col-sm-9">
								<c:forEach var="acheck" items="${fns:getDictList('sys_roles')}">
									<div class="checkbox">
										<label>
											<input name="permission" type="checkbox" class="ace" value="${acheck.value}">
											<span class="lbl">${acheck.label}</span>
										</label>
									</div>
								</c:forEach>								
								<%-- <widgets:select 
									datasource="${fns:getDictList('sys_roles')}" 
								    width="130"
								    uname="update"
								 	dictName="permission" dataPlaceholder="字典类型">
								 </widgets:select> --%>
							</div>
						</div>						
				        <div class="form-group">
							<label class="col-sm-3 control-label no-padding-right">启用</label>
							<div class="col-sm-9" style="margin-top: 5px;">
								<label> 
									<input type="checkbox" class="ace"  name="isEnable" uname="update"/> 
									<span class="lbl"></span>
								</label>	
							</div>
						</div>						
					<div class="space-4"></div>
					<div class="clearfix form-actions">
						<div class="center">
							<button id="btnSubmit" class="btn btn-info" type="button">
								<i class="icon-ok bigger-110"></i> 保存
							</button>
							&nbsp; &nbsp; &nbsp;
							<button class="btn" type="reset">
								<i class="icon-undo bigger-110"></i> 重置
							</button>
						</div>
					</div>
				</form>
				<!-- PAGE CONTENT ENDS -->
			</div>
			<!-- /.modal-content -->
		</div>
		<!-- /.modal-dialog -->	
	</div>
  	<widgets:treeview url="/sys/menu/listDTO" 
  		callbackPID="callbackPID"
  		callbackPIDS="callbackPIDS"
		callbackName="callbackName">
	</widgets:treeview> 
</body>
</html>
